# STEP 1: Build
FROM ccr.ccs.tencentyun.com/magicodes/node:11-alpine as builder
# FROM nikolaik/python-nodejs:latest as builder

RUN mkdir /ng-app

WORKDIR /ng-app

# COPY package.json ./

 #RUN npm config set registry https://registry.npm.taobao.org/

 #RUN npm i

COPY _nginx ./_nginx

 #RUN npm run build


COPY MP_verify_QFxN2YuM6Z5kBC3s.txt ./www/

COPY dist ./www


#STEP 2: Setup
# FROM nginx:1.17.3-alpine
FROM ccr.ccs.tencentyun.com/magicodes/nginx:alpine

COPY --from=builder /ng-app/_nginx/default.conf /etc/nginx/conf.d/

RUN rm -rf /usr/share/nginx/html/*

COPY --from=builder /ng-app/www /usr/share/nginx/html

CMD [ "nginx", "-g", "daemon off;"]
